<html>
<head><meta charset="utf-8"><title>rust-analyzer for rustc w/ neovim + coc.nvim · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html">rust-analyzer for rustc w/ neovim + coc.nvim</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235468156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235468156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joonas Koivunen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235468156">(Apr 21 2021 at 07:43)</a>:</h4>
<p>I'm quite certain that using the recommended configuration on the <a href="https://rustc-dev-guide.rust-lang.org/building/suggested.html">book</a> through <code>:CocConfig</code> used to work, but following one or two stable channel updates now rust-analyzer seems to only invoke <code>cargo check ...</code> instead of <code>./x.py check ...</code>. I cannot see an open bug for this, so is this an user error?</p>
<p>outside of nvim, <code>./x.py check</code> works nicely.</p>



<a name="235471068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235471068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joonas Koivunen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235471068">(Apr 21 2021 at 08:10)</a>:</h4>
<p>Finally found the logs for rust-analyzer, it'd seem that it's log line <code>rust_analyzer::main_loop initial config: Config { ... }</code> contains as expected <code>checkOnSave_overrideCommand</code> to use <code>["./x.py", "check", "--json-output"]</code> (as in the suggested workflows) but still it reports <code>cargo check</code> failed</p>



<a name="235473019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235473019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joonas Koivunen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235473019">(Apr 21 2021 at 08:27)</a>:</h4>
<p>Upgraded to the latest nightly binary build from github <code>2021-04-19-66-g70fe7a451</code> from <code>2021-04-19-1-gd906b7ad8</code>, no change.</p>



<a name="235474169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235474169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235474169">(Apr 21 2021 at 08:37)</a>:</h4>
<p>I think that's the initial <code>cargo check</code> to compile proc macros and run build scripts. I don't think we can currently override the command for that (<span class="user-mention" data-user-id="133169">@matklad</span> ), but you can disable it using <code>rust-analyzer.cargo.runBuildScripts</code> to get rid of the error message</p>



<a name="235474317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235474317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235474317">(Apr 21 2021 at 08:39)</a>:</h4>
<p>also not sure whether we can use <code>x.py</code> for that (probably), and whether our <code>RUSTC_WRAPPER</code> hack would work with that (maybe?)</p>



<a name="235475800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235475800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joonas Koivunen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235475800">(Apr 21 2021 at 08:53)</a>:</h4>
<blockquote>
<p>I think that's the initial <code>cargo check</code> to compile proc macros...</p>
</blockquote>
<p>Aah could very well be. perhaps the only thing which had been upgraded was error reporting from from coc.nvim rust-analyzer extension.</p>



<a name="235476925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235476925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235476925">(Apr 21 2021 at 09:03)</a>:</h4>
<p>yes, it used to just fail silently</p>



<a name="235476954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235476954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235476954">(Apr 21 2021 at 09:03)</a>:</h4>
<p>well also, it was disabled by default until some time ago</p>



<a name="235477268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rust-analyzer%20for%20rustc%20w/%20neovim%20%2B%20coc.nvim/near/235477268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rust-analyzer.20for.20rustc.20w.2F.20neovim.20.2B.20coc.2Envim.html#235477268">(Apr 21 2021 at 09:06)</a>:</h4>
<p>so disabling <code>runBuildScripts</code> basically gives you the behavior from back then</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>